import React, { Component, Fragment } from 'react';
import { connect } from 'dva'
import { Table } from 'antd'

class mechanismChart extends Component {
    constructor(props) {
        super(props)
    }

    render() {
        return (
            <Table
                dataSource={this.props.type == 1 ? this.props.mechanismChartData.companyData : this.props.mechanismChartData.schoolData}
                columns={[
                    { title: this.props.type == 1 ? "申请人（企业）" : "申请人（高校与科研单位）", dataIndex: "applicant", key: "applicant"},
                    { title: "持有量", dataIndex: "value", key: "value", width:100}
                ]}
                pagination={{
                    pageSize: 4
                }}
            >
            </Table>
        )
    }
}

const mapStateToProps = state => {
    let mechanismChartData = state.patentData.mechanismChartData
    return {
        mechanismChartData
    }
}

export default connect(mapStateToProps)(mechanismChart)